﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
    MasterPageFile="~/MasterPage.master" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <div class="col" style="border-right: solid 1px black; text-align: center;">
        <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="Black"
            DayNameFormat="Shortest" Font-Names="Times New Roman" Font-Size="10pt" ForeColor="Black"
            Height="220px" NextPrevFormat="FullMonth" TitleFormat="Month" Width="400px" OnDayRender="Calendar1_DayRender"
            OnSelectionChanged="Calendar1_SelectionChanged">
            <SelectedDayStyle BackColor="#3366CC" ForeColor="White" />
            <SelectorStyle BackColor="#CCCCCC" Font-Bold="True" Font-Names="Verdana" Font-Size="8pt"
                ForeColor="#333333" Width="1%" />
            <TodayDayStyle BackColor="#CCCC99" />
            <OtherMonthDayStyle ForeColor="#999999" />
            <DayStyle Width="14%" />
            <NextPrevStyle Font-Size="8pt" ForeColor="White" />
            <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" ForeColor="#333333"
                Height="10pt" />
            <TitleStyle BackColor="Black" Font-Bold="True" Font-Size="13pt" ForeColor="White"
                Height="14pt" />
        </asp:Calendar>
    </div>
    <div class="col">
        <asp:Label ID="Label1" runat="server" Text="Bạn đang đăng nhập với tài khoản: "></asp:Label>
        <asp:Label ID="lbUsername" runat="server" Font-Bold="True" Font-Italic="True" ForeColor="Red"></asp:Label>
        <br />
        <br />
        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Contact.aspx">Quản 
            lý danh bạ liên lạc</asp:HyperLink>
        <br />
        <br />
        <asp:Label ID="Label2" runat="server" Text="Các sự kiện sắp tới"></asp:Label>
        <br />
        <asp:GridView ID="dvEvents" runat="server" AutoGenerateColumns="False" BackColor="White"
            BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="EventID"
            DataSourceID="sdsEvents" ForeColor="Black" GridLines="Vertical" Width="90%">
            <Columns>
                <asp:BoundField DataField="EventDate" DataFormatString="{0:dd/MM/yyyy HH:mm}" HeaderText="Ngày"
                    SortExpression="EventDate">
                    <ItemStyle Width="25%" />
                </asp:BoundField>
                <asp:BoundField DataField="EventName" HeaderText="Sự Kiện" SortExpression="EventName">
                    <ItemStyle Width="30%" />
                </asp:BoundField>
                <asp:BoundField DataField="EventDescription" HeaderText="Mô Tả" SortExpression="EventDescription">
                    <ItemStyle Width="50%" />
                </asp:BoundField>
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Italic="True" ForeColor="Red"
                    Style="text-align: center" Text="No Event" Width="100%"></asp:Label>
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="#CCCCCC" />
        </asp:GridView>
        <asp:SqlDataSource ID="sdsEvents" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
            
            
            SelectCommand="SELECT TOP (10) EventID, EventName, EventDescription, EventDate FROM DiaryEvent WHERE (EventDate &gt;= @FromDate) AND (EventDate &lt;= @ToDate) AND (DiaryID = @DiaryID) ORDER BY EventDate DESC">
            <SelectParameters>
                <asp:SessionParameter Name="FromDate" SessionField="FromDate" />
                <asp:SessionParameter Name="ToDate" SessionField="ToDate" />
                <asp:SessionParameter Name="DiaryID" SessionField="DiaryID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        <asp:Label ID="Label3" runat="server" Text="Các mục nhật ký gần đây"></asp:Label>
        <asp:GridView ID="gvDiaryEntry" runat="server" AutoGenerateColumns="False" BackColor="White"
            BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataSourceID="sdsDiaryEntry"
            ForeColor="Black" GridLines="Vertical" Width="90%">
            <Columns>
                <asp:BoundField DataField="EntryDate" DataFormatString="{0:dd/MM/yyyy HH:mm}" HeaderText="Ngày"
                    SortExpression="EntryDate">
                    <ItemStyle Width="25%" />
                </asp:BoundField>
                <asp:BoundField DataField="EntryTitle" HeaderText="Tiêu Đề" SortExpression="EntryTitle">
                    <ItemStyle Width="30%" />
                </asp:BoundField>
                <asp:BoundField DataField="EntryText" HeaderText="Nội Dung" SortExpression="EntryText">
                    <ItemStyle Width="55%" />
                </asp:BoundField>
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <asp:Label ID="Label4" runat="server" Font-Bold="True" Font-Italic="True" ForeColor="Red"
                    Style="text-align: center" Text="No Entry" Width="100%"></asp:Label>
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="#CCCCCC" />
        </asp:GridView>
        <asp:SqlDataSource ID="sdsDiaryEntry" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
            
            SelectCommand="SELECT TOP(10) [EntryDate], [EntryTitle], [EntryText] FROM [DiaryEntry] WHERE (([DiaryID] = @DiaryID) AND ([EntryDate] &lt;= @FromDate)) ORDER BY [EntryDate] DESC">
            <SelectParameters>
                <asp:SessionParameter Name="DiaryID" SessionField="DiaryID" Type="Int32" />
                <asp:SessionParameter Name="FromDate" SessionField="FromDate" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
    <div style="clear: both">
</asp:Content>
